package com.nikhil.parameterizedtesting;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class PrimeNumberTest {

	PrimeNumber pN = new PrimeNumber();
	private Integer inputNumber;
	private Boolean expectedresult;

	public PrimeNumberTest(Integer inputNumber, Boolean expectedresult) {
		this.inputNumber = inputNumber;
		this.expectedresult = expectedresult;
	}

	@SuppressWarnings("rawtypes")
	@Parameters
	public static Collection method() {
		return Arrays.asList(new Object[][] { { 2, true }, { 6, true },
				{ 19, true }, { 22, true }, { 23, true } });
	}

	@Test
	public void primeNumbertest() {

		System.out.println("in testing method with inputNumbers" + inputNumber);
		assertEquals(expectedresult, pN.numberDecider(7));

	}

}
